/*****************************************************************************
 * Copyright (C) Stacy Curl. All rights reserved.                            *
 * ------------------------------------------------------------------------- *
 * The software in this package is published under the terms of the BSD      *
 * style license a copy of which has been included with this distribution in *
 * the LICENSE.txt file.                                                     *
 *****************************************************************************/
package picounit.features.signature_factory;

import picounit.features.Feature;
import picounit.features.base.FeatureRegistry;
import picounit.features.base.ProxyFactory;
import picounit.features.mock_collaborator_injection.CollaboratorsInvocationHandler;
import picounit.features.parameter_name.MethodParameterRegistry;
import picounit.mocker.MockFactory;

import java.lang.reflect.InvocationHandler;

public class SignatureFactoryFeature implements Feature {
	private final MethodParameterRegistry methodParameterRegistry;
	private final MockFactory mockFactory;
	private final ProxyFactory proxyFactory;
	private final InvocationHandler collaboratorsInvocationHandler;

	public SignatureFactoryFeature(MethodParameterRegistry methodParameterRegistry,
		MockFactory mockFactory, ProxyFactory proxyFactory,
		CollaboratorsInvocationHandler collaboratorsInvocationHandler) {

		this.methodParameterRegistry = methodParameterRegistry;
		this.mockFactory = mockFactory;
		this.proxyFactory = proxyFactory;
		this.collaboratorsInvocationHandler = collaboratorsInvocationHandler;
	}

	public void addFeatures(FeatureRegistry featureRegistry) {
		featureRegistry.addFeatures(new SignatureFactoryFactory(methodParameterRegistry, mockFactory,
			proxyFactory, collaboratorsInvocationHandler));
	}
}
